const net = require('net')

const server = net.createServer((socket) => {
    console.log('客户端连接：', socket.remoteAddress)



    socket.on('data', (data) => {
        console.log('收到数据:', data.toString());
        socket.write('数据已收到')
    })


    socket.on('end', () => {
        console.log('客户端断开连接')
    })


    socket.on('error', (err) => {
        console.log('客户端错误：', err)
    })


})

const port = 3000


